#ifndef BALL_H
#define BALL_H

#include <QObject>
#include <QPoint>
#include <cmath>

class Ball : public QObject {
    public:
        Ball(double Pos_x = 100, double Pos_y = 100, double predkosc_x = 0, double predkosc_y = 0, double masa = 1); //opisanie kulki
        Ball(const Ball &orig); //klonowanie oginalu
        Ball& operator=(const Ball &orig); //przeladowanie

        QPointF ret_center()		const { return this -> center; }
        double ret_predkosc_x()		const { return this -> predkosc_x; }
        double ret_predkosc_y()		const { return this -> predkosc_y; }
        double ret_masa()		const { return this -> masa; }
        double ret_promien()		const { return this -> promien; }
        bool ret_zderzenie()		const { return this -> zderzenie; }

        void set_center(QPointF val)	{ this -> center = val; }
        void set_pos_x(double val)	{ this -> center.setX(val); }
        void set_pos_y(double val)	{ this -> center.setY(val); }
        void set_predkosc_x(double val)	{ this -> predkosc_x = val; }
        void set_predkosc_y(double val)	{ this -> predkosc_y = val; }
        void set_promien(double val)	{ this -> promien = val; this -> masa = M_PI * pow(promien, 2) / 2; }
        void set_zderzenie(bool val)	{ this -> zderzenie = val; }

        void move();
    private:
        QPointF center;
        double predkosc_x;
        double predkosc_y;
        double masa;
        double promien;
        bool zderzenie;
};

void wall_zderzenie(Ball &one);
void ball_zderzenie(Ball &one, Ball &two);

#endif // BALL_H
